feat: add shareholders, screener, short-trades, rank, stock-events, valuation-comparison APIs#92
Draft
hogan-yuan wants to merge 3 commits into
Draft
feat: add shareholders, screener, short-trades, rank, stock-events, valuation-comparison APIs#92hogan-yuan wants to merge 3 commits into
hogan-yuan wants to merge 3 commits into
Conversation
…ank APIs - fundamental: ShareholderTop, ShareholderDetail, ValuationComparison (3 new methods) - quote: HkShortPositions, ShortTrades with auto market detection (2 new methods) - market: StockEvents (POST), RankCategories, RankList (3 new methods) - screener: new package with ScreenerContext — RecommendStrategies, UserStrategies, Strategy, Search, Indicators (5 new methods) All responses use json.RawMessage for forward-compatible raw data access. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…fied)
short_positions now auto-detects market from symbol suffix:
- .HK → GET /v1/quote/short-positions/hk (HKEX daily data)
- other → GET /v1/quote/short-positions/us (FINRA bi-monthly data)
Response is ShortPositionsResponse{Data json.RawMessage} since HK and US
have different shapes. HkShortPositions and ShortPositionStats removed.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 task
…ata APIs The Go HTTP client already extracts the `data` field from the API envelope before deserializing into the target struct. Wrapping in an intermediate struct with `json:"data"` caused double-unwrapping, producing null Data. Fix: use json.RawMessage directly as the deserialization target in ShareholderTop, ShareholderDetail, ValuationComparison, StockEvents, RankCategories, RankList, all screener methods. Also add missing json:"data" tags to market/types.go and screener/types.go response structs. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports 13 new APIs from longbridge-mcp PR #49 and longbridge-terminal PR #209.
FundamentalContext (3 new methods)
ShareholderTop(symbol)— GET/v1/quote/shareholders/topShareholderDetail(symbol, objectID)— GET/v1/quote/shareholders/holdingValuationComparison(symbol, currency, comparisonSymbols)— GET/v1/quote/compare/valuationQuoteContext (2 new methods)
HkShortPositions(symbol, count)— GET/v1/quote/short-positions/hkShortTrades(symbol, count)— GET/v1/quote/short-trades/hkor/us(auto-detected)MarketContext (3 new methods)
StockEvents(markets, sort, date, limit)— POST/v1/quote/market/stock-eventsRankCategories()— GET/v1/quote/market/rank/categoriesRankList(key, needArticle)— GET/v1/quote/market/rank/listNew ScreenerContext package (5 methods)
ScreenerRecommendStrategies()— GET/v1/quote/screener/strategies/recommendScreenerUserStrategies()— GET/v1/quote/screener/strategies/mineScreenerStrategy(id)— GET/v1/quote/screener/strategyScreenerSearch(market, strategyID, page, size)— POST/v1/quote/screener/searchScreenerIndicators()— GET/v1/quote/screener/indicatorsTest plan
go build ./...✅go vet ./...✅🤖 Generated with Claude Code